<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>

<html>
    <head>
        <title></title>
        <script src="JQUERY/jquery.js"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script>
           
            var icons =[ { pic:"IMAGES/ICONS/disc.png" , name: "CD Drive", ondbclick:"alert('disc image')"},
                {pic:"IMAGES/ICONS/computer.png" , name: "My Computer", ondbclick:"alert('My Computer')"}];
                     
            function adIc() {
                a={ pic:"IMAGES/ICONS/disc.png" , name: "CD Drive", ondbclick:"alert('disc image')"};
                iconAdd(a)
            }
            
            function iconAdd(newIcon) {
                icons[icons.length]=newIcon;
                //alert(icons)
                iconLoad()
            }
            
            
            function iconLoad() {
                var str="";
                try{
                    //alert(icons.length + str);
                    for(i=0;i<icons.length;i++) {
                        str += "<div ondblclick=\""+ icons[i].ondbclick +"\"><img src=\"" + icons[i].pic + "\" /><div>" + icons[i].name + "</div></div>";
                        //    alert(str);
                        document.getElementById("iconHolder").innerHTML=str;    
                    }
                
                }catch(e){
                    alert(e);
                }
            }
            $(document).ready(function(){
                iconLoad();
            });
            
            // iconLoad();
        </script>
    </head>
    <body>
        <!--        <div ondblclick="alert('disc image')"><img src="IMAGES/ICONS/disc.png" />
                <div>CD Drive</div></div>
                <div ondblclick="alert('computer image')"><img src="IMAGES/ICONS/computer.png" />
                <div>My Computer</div></div>-->
        <div id="iconHolder" ></div>
        <input type="button" onclick="adIc()" value="Add Icon"/>

    </body>
</html>
